﻿using Allin.Abp.AspNetCore.Components.Web.AntDesignTheme.Themes.AntDesign.Toolbar;
using Allin.Abp.AspNetCore.Components.Web.Theming.Toolbars;
using System.Threading.Tasks;

namespace Allin.Abp.AspNetCore.Components.Web.AntDesignTheme.Toolbars
{
    public class AntDesignThemeBlazorToolbarContributor : IToolbarContributor
    {
        public virtual Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
        {
            if (context.Toolbar.Name == AntDesignToolbars.Main)
            {
                context.Toolbar.Items.Add(new ToolbarItem(typeof(LanguageSwitchComponent)));
            }

            return Task.CompletedTask;
        }
    }
}
